package com.amit.Basic_Simple_Program;

import java.util.Scanner;

public class Tranpose_Matrics {

	public static void main(String[] args) {
		
		int m,n,c,d;
		int matrics[][];
		int transpose[][]=new int[10][10];
		
		System.out.println("Enter the number of rows and colums of matrics");
		Scanner sc=new  Scanner(System.in);
		m=sc.nextInt();
		n=sc.nextInt();
		
		matrics=new int[m][n];
		
		System.out.println("Enter the element of matrics");
		for(int i=0;i<m;i++)
		{
			for(int j=0;j<n;j++)
			{
				
				matrics[i][j]=sc.nextInt();
			}
		}
		
		
		System.out.println("Tranpose matrics");
		
		for(int i=0;i<m;i++)
		{
			for(int j=0;j<n;j++)
			{
				
				transpose[j][i]=matrics[i][j];
			}
		}
		
		
		for(int i=0;i<n;i++)
		{
			for(int j=0;j<m;j++)
			{
				
				System.out.println(transpose[i][j]);
			}
		}
		
		

	}

}
